home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 168 / MOBICLIC168.ISO / mac / DATA / GAM168 / GAM168_00 / GAM168_00.swf / scripts / frame_59 / PlaceObject2_274_118 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2014-10-17  |  4KB  |  115 lines

  1. onClipEvent(enterFrame){
  2.    if(_global.pauseOnMod == undefined)
  3.    {
  4.       if(getTimer() > origTime + 1500)
  5.       {
  6.          _root.allumePerso();
  7.       }
  8.       Mouse.hide();
  9.       _X = _root._xmouse;
  10.       _Y = _root._ymouse;
  11.       if(_X < this._width / 2)
  12.       {
  13.          _X = this._width / 2;
  14.       }
  15.       if(_X > 800 - this._width / 2)
  16.       {
  17.          _X = 800 - this._width / 2;
  18.       }
  19.       if(_Y < this._height / 2)
  20.       {
  21.          _Y = this._height / 2;
  22.       }
  23.       if(_Y > 600 - this._height / 2)
  24.       {
  25.          _Y = 600 - this._height / 2;
  26.       }
  27.       i = 0;
  28.       while(i < _root.gPersoActive.length)
  29.       {
  30.          if(this.hitTest(_root[_root.gPersoActive[i]]))
  31.          {
  32.             if(Key.isDown(37))
  33.             {
  34.                if(_currentframe === 1)
  35.                {
  36.                   _root.joueBruitage({nomSon:"B_SAUVE"});
  37.                   this.gotoAndPlay(3);
  38.                }
  39.                type = _root.gPersoActive[i].split("")[0];
  40.                switch(type)
  41.                {
  42.                   case "V":
  43.                      if(_currentframe === 3)
  44.                      {
  45.                         _root.joueBruitage({nomSon:"B_ECHEC"});
  46.                      }
  47.                      _root.gScore -= 1;
  48.                      break;
  49.                   case "G":
  50.                      if(_currentframe === 3)
  51.                      {
  52.                         _root.joueBruitage({nomSon:"B_MAGIE"});
  53.                      }
  54.                      _root.tirG.tirTime = getTimer();
  55.                      _root.tirG._x = _X;
  56.                      _root.tirG._y = _Y;
  57.                      _root.gScore += 1;
  58.                }
  59.                _root[_root.gPersoActive[i]]._visible = 0;
  60.                num = _root.gPersoActive[i].split("_")[1];
  61.                _root.eteindrePerso(type,num,1);
  62.             }
  63.             else if(Key.isDown(39))
  64.             {
  65.                if(_currentframe === 1)
  66.                {
  67.                   _root.joueBruitage({nomSon:"B_TIR"});
  68.                   this.gotoAndPlay(2);
  69.                }
  70.                type = _root.gPersoActive[i].split("")[0];
  71.                switch(type)
  72.                {
  73.                   case "V":
  74.                      _root.tirV.tirTime = getTimer();
  75.                      _root.tirV._x = _X;
  76.                      _root.tirV._y = _Y;
  77.                      if(_currentframe === 2)
  78.                      {
  79.                         _root.joueBruitage({nomSon:"B_TUE"});
  80.                      }
  81.                      _root.gScore += 1;
  82.                      break;
  83.                   case "G":
  84.                      if(_currentframe === 2)
  85.                      {
  86.                         _root.joueBruitage({nomSon:"B_ECHEC"});
  87.                      }
  88.                      _root.gScore -= 1;
  89.                }
  90.                _root[_root.gPersoActive[i]]._visible = 0;
  91.                num = _root.gPersoActive[i].split("_")[1];
  92.                _root.eteindrePerso(type,num,1);
  93.             }
  94.          }
  95.          else if(Key.isDown(37))
  96.          {
  97.             if(_currentframe === 1)
  98.             {
  99.                _root.joueBruitage({nomSon:"B_SAUVE"});
  100.                this.gotoAndPlay(3);
  101.             }
  102.          }
  103.          else if(Key.isDown(39))
  104.          {
  105.             if(_currentframe === 1)
  106.             {
  107.                _root.joueBruitage({nomSon:"B_TIR"});
  108.                this.gotoAndPlay(2);
  109.             }
  110.          }
  111.          i++;
  112.       }
  113.    }
  114. }
  115.